package com.markul.android.ui.mark

import androidx.lifecycle.*
import com.markul.android.logic.model.Repository
import com.markul.android.logic.model.room.PublicAlbum
import com.markul.android.logic.model.room.PublicPhoto
import com.markul.android.logic.room.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch


class MarkViewModel: ViewModel() {

    fun addAlbum(album: Album) {
        viewModelScope.launch(Dispatchers.IO) {
            Repository.addAlbum(album)
        }
    }

    fun addPhoto(photo: Photo) {
        viewModelScope.launch(Dispatchers.IO) {
            Repository.addPhoto(photo)
        }
    }

    fun addPAlbum(publicAlbum: PublicAlbum){
        viewModelScope.launch(Dispatchers.IO) {
            Repository.addPublicAlbum(publicAlbum)
        }
    }

    fun addPPhoto(publicPhoto: PublicPhoto){
        viewModelScope.launch(Dispatchers.IO) {
            Repository.addPublicPhoto(publicPhoto)
        }
    }
}
